#ifndef NANE_TYPETRAITS_FUNCTION_H
#   define NANE_TYPETRAITS_FUNCTION_H

namespace nane
{
    template<typename T>
    struct IsFunctionT
    {
        static const bool value = (sizeof(IsFunctionT<T>::template test<T>(0)) == 1);
    private:
        typedef char One;
        typedef struct { char a[2]; } Two;
        template<typename U> static One test(...);
        template<typename U> static Two test(U (*)[1]);
    };

    template<typename T> 
    struct IsFunctionT<T&>
    {
        static const bool value = false;
    };

    template<>
    struct IsFunctionT<void>
    {
        static const bool value = false;
    };

    template<>
    struct IsFunctionT<void const>
    {
        static const bool value = false;
    };

    template<>
    struct IsFunctionT<void volatile>
    {
        static const bool value = false;
    };

    template<>
    struct IsFunctionT<void const volatile>
    {
        static const bool value = false;
    };

}

#endif	// NANE_TYPETRAITS_FUNCTION_H

